package com.flca.base;

import java.util.Properties;

import com.flca.Bootstrapper;
import com.flca.IFlcaStartup;
import com.flca.frw.dao.DatabaseProperties;
import com.flca.frw.dao.util.CreateDatabaseTablesHelper;
import com.flca.frw.util.IConfigurationHelper;
import com.logica.hackthon.HackThonConstants;
import com.logica.hackthon.HackThonModule;

public class InitTablesTool
{
	public static void main(String[] args) throws Exception 
	{
		IFlcaStartup starter = Bootstrapper.startup(HackThonModule.class);
		IConfigurationHelper confighelper = starter.getConfigurationHelper();
		
		String key = confighelper.getProperty(HackThonConstants.DBS_PROPERTIES_KEY);
		Properties properties = confighelper.getProperties(key);
		DatabaseProperties dbprops = new DatabaseProperties(properties);
		CreateDatabaseTablesHelper.initDatabase(dbprops);
		
		System.out.println("*** FINISHED ***");
	}
}
